﻿@model BookShop3Tables.Models.Book

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Book</legend>     

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Saga)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Saga)
            @Html.ValidationMessageFor(model => model.Saga)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ReleaseDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ReleaseDate)
            @Html.ValidationMessageFor(model => model.ReleaseDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Price)
            @Html.ValidationMessageFor(model => model.Price)
        </div>

         @* <div class="editor-label">
            @Html.LabelFor(model => model.Author.FirstName, "Author")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PersonID", String.Empty)
            @Html.ValidationMessageFor(model => model.Author.FirstName)
        </div>*@

      <div class="editor-label">
            @Html.LabelFor(model => model.PersonID, "Author Name")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PersonID", String.Empty)
            @Html.ValidationMessageFor(model => model.Author)
        </div>

       <div class="editor-label">
            @Html.LabelFor(model => model.CategoryID, "Genre")
        </div>
        <div class="editor-field">
             @Html.DropDownList("CategoryID", String.Empty)
            @Html.ValidationMessageFor(model => model.CategoryID)
        </div>


        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
